﻿using System;
using System.Configuration;

namespace TempEmployees.BLL.UserAccess.ActiveDirectory.Configuration
{
    class RolesCollectionElement : ConfigurationElementCollection
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new RoleElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            if (!(element is RoleElement)) throw new ArgumentException("Element is not of type RoleElement");
            return (element as RoleElement).Name;
        }
    }
}
